﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sexybeauty.Core.Inf.Entities.Table;

namespace Sexybeauty.Core.Inf.LogicEntity
{
    public class MemberDetailEntity : IAccessible<MemberDetail, MemberDetailEntity>
    {
        public MemberDetailEntity() { }
        public MemberDetailEntity(MemberDetail memberdetail) 
        {
            if (memberdetail != null)
            {
                Covariant(memberdetail);
            }
        }
        #region Fileds
        public string UserName { get; set; }
        public string Words { get; set; }
        public string MainPhoto { get; set; }
        /// <summary>
        /// 人气
        /// </summary>
        public int Popularity { get; set; }
        /// <summary>
        /// 粉丝
        /// </summary>
        public int Fans { get; set; }
        /// <summary>
        /// 财富 当被支付的时候增加次值
        /// </summary>
        public int Wealth { get; set; }
        public string Alipay { get; set; }
        public string Tenpay { get; set; }
        #endregion

        protected override void Covariant(MemberDetail dbModel)
        {
            this.UserName = dbModel.UserName;
            this.Words = dbModel.Words;
            this.MainPhoto = dbModel.MainPhoto;
            this.Popularity = dbModel.Popularity;
            this.Fans = dbModel.Fans;
            this.Wealth = dbModel.Wealth;
            this.Alipay = dbModel.Alipay;
            this.Tenpay = dbModel.Tenpay;
        }
        protected override MemberDetail Inverter(MemberDetailEntity model)
        {
            return new MemberDetail()
            {
                Fans = model.Fans,
                Alipay = model.Alipay,
                MainPhoto = model.MainPhoto,
                Popularity = model.Popularity,
                Tenpay = model.Tenpay,
                UserName = model.UserName,
                Wealth = model.Wealth,
                Words = model.Words
            };
        }
    }
}
